UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0Zu9XN2exoPyFl4V/yQdjTQWORU5NM07AayOEsZDAYs=' 
WHERE 
  key_id = 'dac7d468a7faa8a4f546949898260e23909338d9db88f04b8eaff45db450c4c1' 
  AND (
    token = '0Zu9XN2exoPyFl4V/yQdjTQWORU5NM07AayOEsZDAYs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022