UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ml+VFncraWJD9xkC/hLGOZQMR+8Th/VT8ol9Y+xupCk='
WHERE
key_id = 'b2f34ebb5767e71eb70beb78021c37599d960c099ee19ab548b2b8842d43d749'
AND (
token = 'Ml+VFncraWJD9xkC/hLGOZQMR+8Th/VT8ol9Y+xupCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)