UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bKZNQv32JL02wS5G05s8+EOvEPA/p10qGnBFqiQ1guY=' 
WHERE 
  key_id = '25e02f661a42163e291aa078167873a73326793e3c3d2ea9dab3c42b98c1877f' 
  AND (
    token = 'bKZNQv32JL02wS5G05s8+EOvEPA/p10qGnBFqiQ1guY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019