UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zTZfxBULUD6Qi4CR7qKnRLivI0BbPoU3O2ul47RbyWs=' 
WHERE 
  key_id = '26d955d457eaaeea424cbefcd61b61cbbb07aa3d9cd11752037cc15daaad07e6' 
  AND (
    token = 'zTZfxBULUD6Qi4CR7qKnRLivI0BbPoU3O2ul47RbyWs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045