UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '33vHpAKa6uwozKWZJMSrSdhRjuva8gcylPGC6bWCVD8=' 
WHERE 
  key_id = '463b364ae7080f140e957b2ca4c65ee11340c56dfb1a8d47b7b06590c6f14bdc' 
  AND (
    token = '33vHpAKa6uwozKWZJMSrSdhRjuva8gcylPGC6bWCVD8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030