UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z4kuKnbqbYh+WSbb8IswU0Wl9uhoaxVnNOvxQaysgc0='
WHERE
key_id = '13179b9331e3c38887fc944e309727a2fe5f3bdba52426a0628d3ea24cd26625'
AND (
token = 'z4kuKnbqbYh+WSbb8IswU0Wl9uhoaxVnNOvxQaysgc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)