UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 't66aiFdxfVmXUEacTmrXtytUdOjT+kJ7g+B0TVnFlTs=' 
WHERE 
  key_id = '937445e879c64cb29f91053940636ebec5da0633db0e3b56cf6e2666de718743' 
  AND (
    token = 't66aiFdxfVmXUEacTmrXtytUdOjT+kJ7g+B0TVnFlTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032