UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EkzzflvLnQScvAYHtfFrBqgTsc4Kag9x53U/3IwKy64='
WHERE
key_id = 'e1997b62192e0e09ed7b2a6433a6fca821e0acccdcd76003841f6e7abeb8a2e0'
AND (
token = 'EkzzflvLnQScvAYHtfFrBqgTsc4Kag9x53U/3IwKy64='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)