UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eYwggA/81NOiUxN7+M5w+kaGIMSaLltdLPYUrc9H2mg=' 
WHERE 
  key_id = '1433b62879e95d7d060dcf592f97ab4e6c1f58eeaa5638f355016b81f882b68e' 
  AND (
    token = 'eYwggA/81NOiUxN7+M5w+kaGIMSaLltdLPYUrc9H2mg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044