UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ieeq+y6NfFOlWNwstRr/y9651UZDvnW+s9CYQzUDj9o=' 
WHERE 
  key_id = '4567b3666f338c9845aa4637af2b8124a8e9919d682a35d9e8a90dc457d0170c' 
  AND (
    token = 'ieeq+y6NfFOlWNwstRr/y9651UZDvnW+s9CYQzUDj9o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033