UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JsvlNEcqeh25WOfjl1sn6V/8vAmVafk5uQhF3U9BwVk='
WHERE
key_id = '8f211be63b92e5f80081000ec14b3c4bc63b1269c3ad0fe0e77c87f36e073266'
AND (
token = 'JsvlNEcqeh25WOfjl1sn6V/8vAmVafk5uQhF3U9BwVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)