UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NVlVXmp70H6UiobfA7lcOYvm1v2lfaQpFiuuAIzFP5E='
WHERE
key_id = '9e3d50a7af6b1be92a983ccfe48e4497d61a9f4332c50ffbef6534c8a61cbca9'
AND (
token = 'NVlVXmp70H6UiobfA7lcOYvm1v2lfaQpFiuuAIzFP5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)