UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9rskQm8bs3q2bxHI6V1TVpVhvcuKcYEjTjfgEcBGwtE=' 
WHERE 
  key_id = 'f80423bb4c217478fdf4194e5b1234a8c3e1ed04a0fefc17f7217f453d0f94b2' 
  AND (
    token = '9rskQm8bs3q2bxHI6V1TVpVhvcuKcYEjTjfgEcBGwtE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046