UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lqMwRtA/7/IXHgavAd9pWy/rU1URtd5RvqUqEqbOulM='
WHERE
key_id = '84b35e1ee27b86bb3f134d6296d9e070cd9b7aa75c697b190f7b7ed8c1e693e1'
AND (
token = 'lqMwRtA/7/IXHgavAd9pWy/rU1URtd5RvqUqEqbOulM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)