UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0mA0hmdwq4ihlU5tLrXMhBkzqtKBlDkEpxhC5BDzxpM='
WHERE
key_id = 'f2cf58cbef4495ed804abad5e632127e65d2c78bc97a383fa83e6bb173429777'
AND (
token = '0mA0hmdwq4ihlU5tLrXMhBkzqtKBlDkEpxhC5BDzxpM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)