UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ppsJspslKyYaHiwqMG3wN9980J7PwNdNxYGlGLdSRNo=' 
WHERE 
  key_id = '11e08ded24fbd20fd1d9957e7918d48688fd775232d0962a4fa195c2a6f57c39' 
  AND (
    token = 'ppsJspslKyYaHiwqMG3wN9980J7PwNdNxYGlGLdSRNo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036