UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IAV6v2lwT/mwv7ga5fUCeWUj0wupPk8vyimh1eXJpcM='
WHERE
key_id = 'd0b95e02b3a61706533291db17d68dabd4345427acbfb8eba559af7cdea0db16'
AND (
token = 'IAV6v2lwT/mwv7ga5fUCeWUj0wupPk8vyimh1eXJpcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)