UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6LZrU+TDuAY6cMAvKk+Rx6KzNeahNRvVz982PEA/Cq4='
WHERE
key_id = '057a3026e18fd9e251f0deb0a6d605710dc9d8ce37fc4f9d364a385179264383'
AND (
token = '6LZrU+TDuAY6cMAvKk+Rx6KzNeahNRvVz982PEA/Cq4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)