UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HRNEhFxOAbq0p0pc+mZosjBg8u3u7yKI7gYL+yqyTvw='
WHERE
key_id = '541f858df0f18f0ca25ec1f615019a1f961dcad2e2de18f46c5485f7b48ae005'
AND (
token = 'HRNEhFxOAbq0p0pc+mZosjBg8u3u7yKI7gYL+yqyTvw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)