UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xqhg7bpoq0KHnh6zhLUhuug692uF76wWDrAUmvORO2E=' 
WHERE 
  key_id = '2fbd1c31566a17593c247ff48af6c718887c1eef950a69da71c0c5ad92cfb3d5' 
  AND (
    token = 'Xqhg7bpoq0KHnh6zhLUhuug692uF76wWDrAUmvORO2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033