UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4SVu7Jxxcqrte64Ingnq/vtaLIASJ+aYtFsJXQrl92w='
WHERE
key_id = 'e99925a02e76cdf0b96c1518f8749e85ebcb0be679a35452f7f7beb4362f8a98'
AND (
token = '4SVu7Jxxcqrte64Ingnq/vtaLIASJ+aYtFsJXQrl92w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)