UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '91H+QFBrhSg+lNKgsE8wAnR0jEav1vwRdgyNcll1GY0='
WHERE
key_id = '5c57c0b5c3b607000245d13755033dc7a2117af5e4d7a020fa7f2e2a9df800ed'
AND (
token = '91H+QFBrhSg+lNKgsE8wAnR0jEav1vwRdgyNcll1GY0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)