UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GtnY0hzeePEjn4+HV+o21rE54cIkGM+jd4g//kHE61o=' 
WHERE 
  key_id = 'f2be8e0e2a86ad9339cdae9fe38607e9ca7aad4e72d24b8a3879b1e57d499da5' 
  AND (
    token = 'GtnY0hzeePEjn4+HV+o21rE54cIkGM+jd4g//kHE61o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027