UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tHyQ5pyyDx4PEXYygD0KiIoehI4YJ/LZZcQzCmmPCdg='
WHERE
key_id = '35b6c313dac4379850e3759e4e17bf67c964860411092aa5ec8693e5d215da55'
AND (
token = 'tHyQ5pyyDx4PEXYygD0KiIoehI4YJ/LZZcQzCmmPCdg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)