UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c3Kn/V50Q6xDApz4rdczAmo1uxzBv7KDCEkpOjJKXBU=' 
WHERE 
  key_id = 'fee763a84dacd1e7be295ed91744da375b8f075f4d6cea2e7d473713a1b82001' 
  AND (
    token = 'c3Kn/V50Q6xDApz4rdczAmo1uxzBv7KDCEkpOjJKXBU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047