UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'do9KLCxBjDP4/Sm9VeN5aZjq9mF6i0WiBy+ZMKu92z0='
WHERE
key_id = '7abd5ffd014aaa6de0d1841e65c2fdae02c903db18ed734a8767064778fd1926'
AND (
token = 'do9KLCxBjDP4/Sm9VeN5aZjq9mF6i0WiBy+ZMKu92z0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)