UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rQzJGeYaAGcAU6Dr3Jq9PbYVwVmM/KJGTECvO8EE2eg=' 
WHERE 
  key_id = 'e25f58d40901c15ea0a0422fb7cc08005c9d3d1a73b338cda4a6a6ad07c6dc9f' 
  AND (
    token = 'rQzJGeYaAGcAU6Dr3Jq9PbYVwVmM/KJGTECvO8EE2eg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036