UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nr4kGlMdXi3/2g4z+O2OoIZQiQdBtw+N77A3iROVnCw=' 
WHERE 
  key_id = '26f52a0ae2c339c71bdcdc9d0956b97192c15005e29be5f3a1926feb0769f72b' 
  AND (
    token = 'nr4kGlMdXi3/2g4z+O2OoIZQiQdBtw+N77A3iROVnCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042