UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IxmBvHvnMZgxi2d+oymU2H2jekE7DdZ766xVLjg8kaU='
WHERE
key_id = '3e31fb3fec1d79d421c4f747662a72d71357854f3c2cfbc0510a9a59a04c95af'
AND (
token = 'IxmBvHvnMZgxi2d+oymU2H2jekE7DdZ766xVLjg8kaU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)