UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UeoVUdbkcMPQ7fVqGs2T7rLBMZKT/fA231UuLGQUebg=' 
WHERE 
  key_id = '0e1432d2125a66a73f9bb8d25c7ca37fa47064f2aa7bb3360f047b0321ae7c76' 
  AND (
    token = 'UeoVUdbkcMPQ7fVqGs2T7rLBMZKT/fA231UuLGQUebg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038