UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V+REKCpKkhBTxQronYtRikWAI9lA4/56yV8MLp18Dn4=' 
WHERE 
  key_id = '5e6709ac99fbf5c57ada58506c1ba17d1f61860b64e58f0f49454e64c4091d48' 
  AND (
    token = 'V+REKCpKkhBTxQronYtRikWAI9lA4/56yV8MLp18Dn4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028