UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LMwv5mzVL6zH5gsuRLx2O+slvb4eMRK78reeLIhe540=' 
WHERE 
  key_id = 'b07a0d0d7e9b1bb15ea593f47442f8b558d2c2d424b053ae98e81dd0de977508' 
  AND (
    token = 'LMwv5mzVL6zH5gsuRLx2O+slvb4eMRK78reeLIhe540=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034