UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mw0FIUOsokxzFbRf4wuVbn5I3jzT1B9XeRjOKzySfMA='
WHERE
key_id = '80dbae4b705f54d3f4e7264ec20941f2b6fa7bf7dbc913451bd77cf9200034ec'
AND (
token = 'mw0FIUOsokxzFbRf4wuVbn5I3jzT1B9XeRjOKzySfMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)