UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rFORzs8RhCTV/RVPdf6Tjna/2Dj9ayW7CoXreBlQIGo=' 
WHERE 
  key_id = 'ef308911d39bbf62cc4ac0ac524d1cd75d03221592eac347c0bbe3d145b6d757' 
  AND (
    token = 'rFORzs8RhCTV/RVPdf6Tjna/2Dj9ayW7CoXreBlQIGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041