UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9pnZWlnW0VtqHRQgXh+waPPz7jwPscmp6Pbdr+5FAQc='
WHERE
key_id = 'ee9743e7ab4261e781534854e6b17d033020203013875fcb0e4775eb547af0cb'
AND (
token = '9pnZWlnW0VtqHRQgXh+waPPz7jwPscmp6Pbdr+5FAQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)