UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iwFkT/eJHpyMGfY7heLG6UAVv/cTxar3q5tku/MYcUE=' 
WHERE 
  key_id = '39fec62ceb7dc65f2ca67ae3469f2530fa02c8fa3ee3dd4921f012c90ef4e165' 
  AND (
    token = 'iwFkT/eJHpyMGfY7heLG6UAVv/cTxar3q5tku/MYcUE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022