UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WuZTMLLGeq45KxTjXfEpF1+NAkq0FijWQEVXUFI23s0=' 
WHERE 
  key_id = '49ffcc3cb5f07d33319aac8da6a6a9c9f29e59e894786155ec7c425d217439ba' 
  AND (
    token = 'WuZTMLLGeq45KxTjXfEpF1+NAkq0FijWQEVXUFI23s0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052