UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PA2QFbTo5CxbiuPRp6DJM8Y1GjJA39Hgf0cmHXxOvk8=' 
WHERE 
  key_id = 'd33c303c067d2ee825d5376df913e6f30102d618b0c1b62ddcf94087013479ff' 
  AND (
    token = 'PA2QFbTo5CxbiuPRp6DJM8Y1GjJA39Hgf0cmHXxOvk8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029