UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zuSLfxaiICU0vFSH+xQck4u8xYoyo21aRu8mZAgw7sA='
WHERE
key_id = '6647d5f6298d3e3fd2fe808206fcec83f9ac7cff2ba4ca88198bdb4bdbe008f2'
AND (
token = 'zuSLfxaiICU0vFSH+xQck4u8xYoyo21aRu8mZAgw7sA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)