UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MJNmsUAEzORe8//sTziPa/z+i2TgBKB4L10btlKPSTY='
WHERE
key_id = '67e8a04ff1cb384014f21f8b42c8589b091db3fb937fa374faa23847c918841f'
AND (
token = 'MJNmsUAEzORe8//sTziPa/z+i2TgBKB4L10btlKPSTY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)