UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LVzOtxXRic9VurjFKV1yubb4QjtaX8TSmYa1Y1IlG5w=' 
WHERE 
  key_id = 'ed99c07a94be761b9cf6ef694ab2bc60546f94862e90dbeac3b65d5be150b484' 
  AND (
    token = 'LVzOtxXRic9VurjFKV1yubb4QjtaX8TSmYa1Y1IlG5w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029