UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DlHHdYWrKSKaqhhtHUMYGPKnAaED6UhC92uwFTaWXIU='
WHERE
key_id = 'd77d6e447f4f5619b9849abb6080eaa08dcce1568616580f9a27aa767473f41a'
AND (
token = 'DlHHdYWrKSKaqhhtHUMYGPKnAaED6UhC92uwFTaWXIU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)