UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UZkBBI6XOnJfTH/YEIm1wZBGPoX6ZAYzysnmS6TOksw='
WHERE
key_id = '342a6801a5a4eea120165555f6b30aaf991c288f4fa53d4a70f31edcbb19929d'
AND (
token = 'UZkBBI6XOnJfTH/YEIm1wZBGPoX6ZAYzysnmS6TOksw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)