UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8cL+ibr4ul7Vvibvl0mcF1XQw9nuSsB5kAgGgEEKkqM=' 
WHERE 
  key_id = '5b5ec8486e15c37925dc908daa4df3d3b01062a0ec304277ac39717ff9587412' 
  AND (
    token = '8cL+ibr4ul7Vvibvl0mcF1XQw9nuSsB5kAgGgEEKkqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022