UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zvlbxVz7z8caSvudR96Za0+ctxzHoZd3hzfIzGGtxBA=' 
WHERE 
  key_id = '1361bd1080ad60318c24dd5e45f16ca8e1d56ad7541d3db0ed1dfbea3011a0f4' 
  AND (
    token = 'zvlbxVz7z8caSvudR96Za0+ctxzHoZd3hzfIzGGtxBA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034