UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K0VHUCMZmiXF9x6KUl9GK4Q0Oz1cKeFeYu+lu0SOHiU='
WHERE
key_id = 'e9e9bf71270b9d6555557428fab72d82eb29c549e3688b724a0c7f97d8eb626b'
AND (
token = 'K0VHUCMZmiXF9x6KUl9GK4Q0Oz1cKeFeYu+lu0SOHiU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)