UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PTVEhJoKA/DgZYd4wFHy1LFSsJffonojwlnDt6bgZJM=' 
WHERE 
  key_id = '54a69423e12a1bc77ef2929eed9db67ac5f4dafce6e7e6414d66fff5c3377f74' 
  AND (
    token = 'PTVEhJoKA/DgZYd4wFHy1LFSsJffonojwlnDt6bgZJM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026