UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/vY13d90HI0mPOL7kTof8Z4EtYz/CXbRYmHOBptTXQM=' 
WHERE 
  key_id = '29a9d6b59ef32dd70e722d88240e3657e14cb4666a3b3e7a512cba0d096e3689' 
  AND (
    token = '/vY13d90HI0mPOL7kTof8Z4EtYz/CXbRYmHOBptTXQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029