UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZagSnomHHXFxqL6SSrHF4pv3fupuEqIWXuv2ANb3jA8='
WHERE
key_id = '16326dd6735021adddc485be4bf91b39eaaffdcc2cdece0ea3c4ba1343210b9d'
AND (
token = 'ZagSnomHHXFxqL6SSrHF4pv3fupuEqIWXuv2ANb3jA8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)