UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'smhQDJI6yemc7MefSXFvhwt+51+kEOCy8DS4EzLgQ/M=' 
WHERE 
  key_id = '3c976b26a7edcfcb853acba2932e2174509bd119a2efadb48f1ea4bd6f702ffa' 
  AND (
    token = 'smhQDJI6yemc7MefSXFvhwt+51+kEOCy8DS4EzLgQ/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025