UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Q/g1iY4XmgvNb1ronsQx5wNkFquzKuCgdx9xIuFIcA='
WHERE
key_id = '719cb76d8360adabb8b7099a88f5df563dcb88691b38d67b9007ef8137ec1515'
AND (
token = '2Q/g1iY4XmgvNb1ronsQx5wNkFquzKuCgdx9xIuFIcA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)