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

Query time 0.00039