UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'esXwSak61zY3ejJgQfDTplR/7Tmp3fJH7Fa5C5oU3No='
WHERE
key_id = '91ae540ce601f997463119648e64867730ca68c1392b8fc0c96f2c604696795e'
AND (
token = 'esXwSak61zY3ejJgQfDTplR/7Tmp3fJH7Fa5C5oU3No='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)