UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oGcw2i8ZD4rzGi7CrnHPai+q1xnOvzCtBZUI3V/ZRvs='
WHERE
key_id = 'd7fa02e40d577587cc8c5e84a66b76076fdb77a60165fc017813b6f1d2a01e64'
AND (
token = 'oGcw2i8ZD4rzGi7CrnHPai+q1xnOvzCtBZUI3V/ZRvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)