UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AkohdxCZzQXZfuzS4kJGVw+hZ+eB9lZrvgG6kVAg9Bw='
WHERE
key_id = '8f955a9a55a5fcd6e67fa71f4844bf74474817f21843bc83b325aef50652e148'
AND (
token = 'AkohdxCZzQXZfuzS4kJGVw+hZ+eB9lZrvgG6kVAg9Bw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)