UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lP2KCKyc/TNTXd8dpKCkMWS+/NiqFQsh9aHHXDftCN4='
WHERE
key_id = 'be57a93e74af09a67f8a9f929dc04906138b0f50d3b5d736c4acffe44d3aa492'
AND (
token = 'lP2KCKyc/TNTXd8dpKCkMWS+/NiqFQsh9aHHXDftCN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)