UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VNTcC8Cv7Fh4CDX4X+Ib1u/+r+o+V/1XOEe1QC77jRE='
WHERE
key_id = '4d64f0edf2e6729649e9fbc5ac5fb32143cfa9f960da6b196c532d5bacd21317'
AND (
token = 'VNTcC8Cv7Fh4CDX4X+Ib1u/+r+o+V/1XOEe1QC77jRE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)