UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QFW+7h05fbxWfGykXNjvDlximTTIlJwVLajDgPDlccc='
WHERE
key_id = 'a8250eefa1844c333cbb8849cbbabe9f6497b1d24299fb6725406efe0c53446d'
AND (
token = 'QFW+7h05fbxWfGykXNjvDlximTTIlJwVLajDgPDlccc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)